package com.wx.spring.mvc;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName BindingRequestAndModel
 * @Author wx
 * @Description 绑定Model数据到request
 * @Date 2019-01-30-18:51
 */
public class BindingRequestAndModel {
    public static void bindingRequestAndModel(MyModelAndView myModelAndView, HttpServletRequest request) {
        MyModelMap myModelMap = myModelAndView.getModelMap();
        if (myModelMap != null && !myModelMap.isEmpty()){
            myModelMap.forEach((k,v)->{
                request.setAttribute(k,v);
            });
        }
    }
}
